const proxy = require('http-proxy-middleware');

module.exports = function (app) {
  // 接口代理
  app.use(
    proxy.createProxyMiddleware('/api', {
      target: 'http://localhost:4001/',
      changeOrigin: true,
    })
  );

  // 上传代理
  app.use(
    proxy.createProxyMiddleware('/upload', {
      target: 'http://localhost:4001/',
      changeOrigin: true,
    })
  );
}